package com.heima.user.feign;

import com.heima.common.dto.ResponseResult;
import com.heima.user.dto.ApAuthor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author zsk
 * @create 2022-04-11-14:27
 */
@FeignClient(value = "leadnews-article")
public interface ArticleFeign {


    /**
     * 新增作者信息
     * @param author
     * @return
     */
    @PostMapping("/api/v1/author")
    public ResponseResult<ApAuthor> saveAuthor(@RequestBody ApAuthor author);

    /**
     * 根据前端传递id查询作者信息
     * @param id
     * @return
     */
    @GetMapping("/api/v1/author/{id}")
    public ResponseResult<ApAuthor> findById(@PathVariable("id") Integer id);
}
